﻿using System;
using System.Collections.Generic;
using DotNet.DevOps.Tasks.Util;

namespace DotNet.DevOps.Tasks.AssemblyInfo.Updaters
{
    internal class StandardUpdater : PropertyUpdater
    {
        private Dictionary<String, String> properties;

        public StandardUpdater(AssemblyInfo asm, ILog logger)
            : base(asm, logger)
        {
        }

        protected override Dictionary<string, string> GetPropertyNameValuePairs()
        {
            return properties ?? (properties = asm.GetStandardStringPropertyNameValuePairs());
        }

        protected override String GetNewEntryValue(String keyName, String oldValue)
        {
            return properties[keyName];
        }
    }
}
